﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace CandleStickChart.Stock
{
    public class StockItem : INotifyPropertyChanged
    {
        private DateTime _date;

        public DateTime Date
        {
            get { return _date; }
            set { _date = value; RaisePropertyChanged("Date"); }
        }


        private double _open;

        public double Open
        {
            get { return _open; }
            set { _open = value; RaisePropertyChanged("Open"); }
        }
        private double _high;

        public double High
        {
            get { return _high; }
            set { _high = value; RaisePropertyChanged("High"); }
        }

        private double _low;

        public double Low
        {
            get { return _low; }
            set { _low = value; RaisePropertyChanged("Low"); }
        }

        private double _close;

        public double Close
        {
            get { return _close; }
            set { _close = value; RaisePropertyChanged("Close"); }
        }

        public StockItem(DateTime date, double open, double high, double low, double close)
        {
            this.Date = date;
            this.Open = open;
            this.High = high;
            this.Low = low;
            this.Close = close;
        }
        public StockItem()
        {

        }
        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;
        private void RaisePropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
        #endregion
    }
    public class StockItemConverted : INotifyPropertyChanged
    {
        private double _date;

        public double Date
        {
            get { return _date; }
            set { _date = value; RaisePropertyChanged("Date"); }
        }


        private double _open;

        public double Open
        {
            get { return _open; }
            set { _open = value; RaisePropertyChanged(" Open"); }
        }
        private double _high;

        public double High
        {
            get { return _high; }
            set { _high = value; RaisePropertyChanged("High"); }
        }

        private double _low;

        public double Low
        {
            get { return _low; }
            set { _low = value; RaisePropertyChanged("Low"); }
        }

        private double _close;

        public double Close
        {
            get { return _close; }
            set { _close = value; RaisePropertyChanged("Close"); }
        }


        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;
        private void RaisePropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
        #endregion
    }
}
